package com.example.mybatis.service;

import com.example.mybatis.mapper.UserMapper;
import com.example.mybatis.model.UserInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {

    @Resource
    private UserMapper userMapper;

    // 不自己操作，调用 usermapper
    public UserInfo getUserById(Integer id){
        return userMapper.getUserById(id);
    }

    public int upDate(Integer id, String username){
        return userMapper.update(id,username);
    }
}
